<include file="header" />
<head>
	<link rel="stylesheet" href="/assets/base/repair/js/sweetalert/lib/sweet-alert.css">
</head>
<body>
<div class="wraper">
    <div class="load">
        <img class="load-bee" src="/assets/base/restaurant/images/load-bee.png"/>

    </div>
    <div class="top">
        <p>
            <a href="/base/restaurant/menu/restaurant_id/{BEESCRM:$restaurant_id}/res_id/{BEESCRM:$res_id}" class="iconfont icon-zuo pull-left"></a>
            <a href="#" class="order-all pull-left">确认订单</a>
        </p>
    </div>
	<div style="color: red;text-align: center;width: 100%;height: 25px;line-height: 25px;margin-top: 6px;">温馨提示：请及时付款</div>
    <div class="order-info">
        <div class="lists">配送地址</div>
        <div class="lists tb-mode">
            <div class="tb-cell list-left">
	            <p><span class="user-name">{BEESCRM:$address['real_name']}</span>{BEESCRM:$address['mobile']}</p>
	            <p>{BEESCRM:$address['community_name']}{BEESCRM:$address['building_name']}{BEESCRM:$address['room']}{BEESCRM:$address['address_detail']}</p>
	            <input type="hidden" class="address_id" value="{BEESCRM:$address['address_id']}">
	            <input type="hidden" class="username" value="{BEESCRM:$address['real_name']}">
	            <input type="hidden" class="mobile" value="{BEESCRM:$address['mobile']}">
	            <input type="hidden" class="address" value="{BEESCRM:$address['community_name']}{BEESCRM:$address['building_name']}{BEESCRM:$address['room_name']}{BEESCRM:$address['address_detail']}">
            </div>
            <div class="tb-cell list-right"><a id='change_addr' onclick="huoqu()" data-url="/base/address/address/order_id/{BEESCRM:$order_id}/res_id/{BEESCRM:$res_id}/type/1001" class="order-btn">更换地址</a></div>
        </div>
    </div>
    <div class="order-info">
        <div class="lists tb-mode">
            <div class="tb-cell list-left">就餐时间</div>
            <div class="tb-cell list-right">
                <select id="send_time">
	                <volist name="time" id="vo">
		                <option <if condition="$stime eq $vo">selected</if> >{BEESCRM:$vo}</option>
	                </volist>
                </select>
                <span class="triangle"></span>
            </div>
        </div>
    </div>
    <div class="order-info">
        <div class="lists tb-mode">
            <div class="tb-cell list-left">支付方式</div>
            <div class="tb-cell list-right" style="width: 50%;" id="pay_type">
                <if condition = "$account_id eq 47 or $account_id eq 60 or $account_id eq 61 or $account_id eq 4">
	                <a href="#" <if condition = "$pay_type eq 3">class="order-btn weipay weipay_check"<else />class="order-btn weipay btn-gray"</if> class="order-btn weipay btn-gray" data-type="3"  style="margin-right: 4px;">虚拟e卡支付</a>
                </if>
	            <a href="#" <if condition = "$pay_type eq 1">class="order-btn weipay weipay_check"<elseif condition = "$account_id eq 47 or $account_id eq 60 or $account_id eq 61 or $account_id eq 4" />class="order-btn weipay btn-gray"<else />class="order-btn weipay weipay_check"</if>  data-type="1">微信支付</a>
            </div>
        </div>
    </div>
    <div class="order-lists lists">
        <div class="lists tb-mode">
            <a href="#" class="tb-cell list-left">菜单详情<!--（<span class="num">2</span>个菜）--></a>
        </div>
        <volist name="data.RestaurantOrderGoods" id="vo">
	    <div class="lists tb-mode foods">
            <a href="#" class="tb-cell list-left">
                <div class="img-box"><img src="{BEESCRM:$vo['goods_logo']}"></div>
            </a>
            <a href="#" class="tb-cell list-center">
                <p>{BEESCRM:$vo['goods_name']}</p>
                <p class="prize">{BEESCRM:$vo['goods_price']}元</p>
            </a>
            <div class="tb-cell list-right">
                <div class="tb-mode amount" style="text-align: center;border:0;">
	                {BEESCRM:$vo['goods_num']}
                </div>
            </div>
        </div>
        </volist>
        <div class="lists tb-mode">
            <div class="tb-cell list-right">总价：<span class="num">{BEESCRM:$data.moneySum}元<if condition="$shipment gt 0">+{BEESCRM:$shipment}运费</if></span></div>
        </div>
        <div class="lists bottom-none">
            <input value="" placeholder="特殊需要请备注" id="memo"/>
        </div>
    </div>
	<input type="hidden" class="restaurant_id" value="{BEESCRM:$restaurant_id}">
	<input type="hidden" id="res_id" value="{BEESCRM:$res_id}">
    <input type="hidden" id="stored_value_id" value="{BEESCRM:$stored_value_id}">
    <input type="hidden" id="parames" value="{BEESCRM:$parames}">
    <input type="hidden" id="no_bind" value="{BEESCRM:$no_bind}">
    <div class="btn-box">
        <a href="#" class="btn green-btn pay-btn" data-order_id="{BEESCRM:$order_id}">立即付款</a>
    </div>
</div>

<include file="commonJS" />
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="/assets/base/restaurant/js/order.js"></script>
<script>
    $('.classify').click(function(){
        $('.menu-lists').addClass('show-menu');
    });
    $('.close').click(function(){
        $('.menu-lists').removeClass('show-menu');
    });

    $("#pay_type").on("click",".weipay",function () {
        $(this).removeClass('btn-gray').addClass('weipay_check').siblings().removeClass('weipay_check').addClass('btn-gray');
    });

    function huoqu(){
        var oid = '';
    $('#send_time option').each(function(){
        if($(this).prop('selected') == true) {
            oid = $(this).html();
            return;
        }
    });
    if(oid) {
        location.href = $('#change_addr').data('url')+'/stime/'+oid;
    }
    }
</script>
</body>
</html>
